home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
MRAC
/
Generate
/
g-seed
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-20
|
1KB
|
28 lines
g-seed seed count
The random seed is an essential part of many SCOM functions. By setting the seed to a particular value the composer may recapture exactly a generative process involving some element of randomization.
(setq len
(list
(permute-unique (qlength '(20-10000)))
(permute-unique (qlength '(20-2000)))
(permute-unique (qlength '(20-300)))
(permute-unique (qlength '(4-1)))
(permute-unique (qlength '(20-7000)))
(permute-unique (qlength '(20-[11]0000)))
(permute-unique (qlength '(20-[13]00)))
(permute-unique (qlength '(20-[17]000)))))
(append-sublist
(mapcar #'(lambda (x y)
(gen-random x 1 y))
(g-seed .23 12)
(cfunction (gen-noise-white 12 1.0 .23) len)))
=> ((-1/20 3/20 -1/20) (1/20 -1/20 -1/20 -1/20 -1/20)
(2/20 -1/20 -1/20 -1/20) (-1/20 -1/20 3/20)
(-1/20 7/20 -1/20 -1/20) (11/20 -1/20 -1/20 -1/20 -1/20)
(-1/20 -1/20 7/20 -1/20) (2/20 -1/20 -1/20 -1/20)
(-1/20 -1/20 3/20) (1/4) (-1/20 3/20 -1/20)
(17/20 -1/20 -1/20 -1/20))